<template>
  <div class="upload">
    <input type="file" @change="handleFileChange" />
    <el-button @click="handleUpload">upload</el-button>
  </div>
</template>

<script setup>
import { reactive } from "@vue/reactivity";

const SIZE = 10 * 1024 * 1024; 
const container = reactive({
  file: null
})

const handleFileChange = (e) => {
  const [file] = e.target.files;
    if (!file) return;
    container.file = file

}

const createFileChunk = (file, size = SIZE) => {
  const fileChunkList = [];
  let cur = 0;
  while (cur < file.size) {
    fileChunkList.push({ file: file.slice(cur, cur + size) });
    cur   = size;
  }
  return fileChunkList;
}
</script>

<style lang="scss" scoped>
</style>
